home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15210 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: [Q] Any utility to attack misuse of comment /* */
  5. Date: 17 Apr 1996 11:58:29 -0700
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4l3f0lINNdu7@keats.ugrad.cs.ubc.ca>
  8. References: <4l32et$bhm@sun.rhbnc.ac.uk>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4l32et$bhm@sun.rhbnc.ac.uk>, Jim Hu  <jim@gl.rhbnc.ac.uk> wrote:
  12.  >Ho, there,
  13.  >
  14.  >    I found out gcc and C provided by SGI for irix fail
  15.  >to find out bug like this
  16.  >
  17.  >/*
  18.  >     statements;
  19.  >
  20.  >/*
  21.  >   comments
  22.  >*/
  23.  >
  24.  >     other_statements;
  25.  >
  26.  >
  27.  >    As you can, */ is missed out in the first case, the compilers
  28.  >failed to find out this obvious error. Is there any free utility to
  29.  >attack this bug. This bug can easily appear when you comment/uncomment
  30.  >frequently.
  31.  
  32. Really? Even the lexical analyzer I wrote in an undergraduate compiler
  33. construction course checked for the start of a comment within a comment, and
  34. produced a warning diagnostic. This is not a hard thing, and I'm sure GCC has
  35. it.
  36.  
  37. Do you have -Wall turned on?
  38.  
  39. latte:~>gcc -Wall test.c
  40. test.c:3: warning: `/*' within comment
  41.  
  42. There ya go.
  43.  
  44.  >    Please help via email or send me a copy if reply here.
  45.  
  46. Ah yes. Plenty of time to chase down utilities for simple lexical errors that
  47. any proficient text mangler can detect with vi, but not enough time to check
  48. for replies in a newsgroup or RTFM on GCC.
  49. -- 
  50. I'm not really a jerk, but I play one on Usenet.
  51.